Downhole X-ray source fluid identification system and method

ABSTRACT

A method and system for determining a property of a sample of fluid in a borehole. A fluid sample is collected in a downhole tool. While collecting, X-rays are transmitted proximate the fluid from an X-ray source in the tool and an X-ray flux that is a function of a property of the fluid is detected. The detected X-ray flux data is processed to determine the property of the fluid.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a 35 U.S.C. §371 national stage application ofPCT/US2008/083422 filed 13 Nov. 2008, which claims the benefit of U.S.Provisional Patent Application No. 60/987,729 filed 13 Nov. 2007, bothof which are incorporated herein by reference in their entireties forall purposes.

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

Not Applicable.

BACKGROUND

During the drilling and completion of oil and gas wells, it may benecessary to engage in ancillary operations, such as monitoring theoperability of equipment used during the drilling process or evaluatingthe production capabilities of formations intersected by the wellbore.For example, after a well or well interval has been drilled, zones ofinterest are often tested to determine various formation properties suchas permeability, fluid type, fluid quality, formation temperature,formation pressure, bubblepoint and formation pressure gradient. Thesetests are performed in order to determine whether commercialexploitation of the intersected formations is viable and how to optimizeproduction.

Wireline formation testers (WFT) and drill stem testing (DST) have beencommonly used to perform these tests. The basic DST test tool consistsof a packer or packers, valves or ports that may be opened and closedfrom the surface, and two or more pressure-recording devices. The toolis lowered on a work string to the zone to be tested. The packer orpackers are set, and drilling fluid is evacuated to isolate the zonefrom the drilling fluid column. The valves or ports are then opened toallow flow from the formation to the tool for testing while therecorders chart static pressures. A sampling chamber traps cleanformation fluids at the end of the test. WFTs generally employ the sametesting techniques but use a wireline to lower the test tool into thewell bore after the drill string has been retrieved from the well bore,although WFT technology is sometimes deployed on a pipe string. Thewireline tool typically uses packers also, although the packers areplaced closer together, compared to drill pipe conveyed testers, formore efficient formation testing. In some cases, packers are not used.In those instances, the testing tool is brought into contact with theintersected formation and testing is done without zonal isolation acrossthe axial span of the circumference of the borehole wall.

WFTs may also include a probe assembly for engaging the borehole walland acquiring formation fluid samples. The probe assembly may include anisolation pad to engage the borehole wall. The isolation pad sealsagainst the formation and around a hollow probe, which places aninternal cavity in fluid communication with the formation. This createsa fluid pathway that allows formation fluid to flow between theformation and the formation tester while isolated from the boreholefluid.

In order to acquire a useful sample, the probe must stay isolated fromthe relative high pressure of the borehole fluid. Therefore, theintegrity of the seal that is formed by the isolation pad is critical tothe performance of the tool. If the borehole fluid is allowed to leakinto the collected formation fluids, a non-representative sample will beobtained and the test will have to be repeated.

Examples of isolation pads and probes used in WFTs can be found inHalliburton's DT, SFTT, SFT4, and RDT tools. Isolation pads that areused with WFTs are typically rubber pads affixed to the end of theextending sample probe. The rubber is normally affixed to a metallicplate that provides support to the rubber as well as a connection to theprobe. These rubber pads are often molded to fit within the specificdiameter hole in which they will be operating.

With the use of WFTs and DSTs, the drill string with the drill bit mustbe retracted from the borehole. Then, a separate work string containingthe testing equipment, or, with WFTs, the wireline tool string, must belowered into the well to conduct secondary operations. Interrupting thedrilling process to perform formation testing can add significantamounts of time to a drilling program.

The formation pressure measurement accuracy of drill stem tests and,especially, of wireline formation tests may be affected by filtrateinvasion and mudcake buildup because significant amounts of time mayhave passed before a DST or WFT engages the formation. Mud filtrateinvasion occurs when the drilling mud fluids displace formation fluids.Because the mud filtrate ingress into the formation begins at theborehole surface, it is most prevalent there and generally decreasesfurther into the formation. When filtrate invasion occurs, it may becomeimpossible to obtain a representative sample of formation fluids or, ata minimum, the duration of the sampling period must be increased tofirst remove the drilling fluid and then obtain a representative sampleof formation fluids. The mudcake is made up of the solid particles thatare plastered to the side of the well by the circulating drilling mudduring drilling. The prevalence of the mudcake at the borehole surfacecreates a “skin.” Thus there may be a “skin effect” because formationtesters can only extend relatively short distances into the formation,thereby distorting the representative sample of formation fluids due tothe filtrate. The mudcake also acts as a region of reduced permeabilityadjacent to the borehole. Thus, once the mudcake forms, the accuracy ofreservoir pressure measurements decreases, affecting the calculationsfor permeability and producibility of the formation.

Another testing apparatus is the formation tester while drilling (FTWD)tool. Typical FTWD formation testing equipment is suitable forintegration with a drill string during drilling operations. Variousdevices or systems are used for isolating a formation from the remainderof the borehole, drawing fluid from the formation, and measuringphysical properties of the fluid and the formation. For example, theFTWD may use a probe similar to a WFT that extends to the formation anda small sample chamber to draw in formation fluids through the probe totest the formation pressure. To perform a test, the drill string isstopped from rotating and the test procedure, similar to a WFT describedabove, is performed.

Formation fluids of interest consist of liquid hydrocarbons of varyingdensities, typically less than that of water. On the other hand drillingfluids are usually of higher average density containing weightingmaterial such as barite, calcium carbonate, hematite, etc. in solutionor suspension. Hydrocarbon molecules consist of varying combinations ofhydrogen, carbon, and oxygen atoms, resulting in fluid densities lessthan that of water from a few percent to several tens of percent.Borehole fluids typically are more dense than water, by factors ofbetween one and two. Significantly higher densities than water in thisrange are more likely, because fluid samples are taken at target depthswhere the pressures are usually highest for the particular well. For thepurpose of well control, the borehole fluid densities are increased tooffset the effects of these downhole pressures. Usually a significantcontrast between the borehole fluid density and the density of theformation fluids results.

In addition, the higher borehole fluid densities are obtained byincluding weighting materials mentioned above. The presence of thesematerials affects not only the density of the fluid but the spectralcharacteristics as well.

As mentioned, the representative sample of the formation fluid may bedistorted by the present of filtrate and may also be distorted by thepresence of borehole fluid if a proper seal is not obtained beforetaking the same or if the borehole fluid otherwise makes it into thesample chamber. Thus, borehole fluid is a possible “pollutant” in theearly phases of the extraction, and the sample drawn from the formationshould be relatively free of borehole fluid material to maintain anaccurate measurement. Systems have been proposed that analyze, oridentify, the sample fluid to determine the fluid identification. Suchsystems typically use optical sensors or sensors that measure otherphysical properties of the fluid. However, such systems do notnecessarily provide a measure of the homogeneity of the fluid beingtested.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more detailed description of the embodiments, reference will nowbe made to the following accompanying drawings:

FIG. 1 is a schematic diagram of a modular downhole formation-testingtool;

FIG. 2 is an example of a spectral response of a Cadmium Zinc Telluride(CZT) detector; and

FIG. 3 is a schematic diagram of the X-RAY source and detectorcombination system.

DETAILED DESCRIPTION OF THE EMBODIMENTS

In the drawings and description that follows, like parts are markedthroughout the specification and drawings with the same referencenumerals, respectively. The drawing figures are not necessarily toscale. Certain features of the invention may be shown exaggerated inscale or in somewhat schematic form and some details of conventionalelements may not be shown in the interest of clarity and conciseness.The present invention is susceptible to embodiments of different forms.Specific embodiments are described in detail and are shown in thedrawings, with the understanding that the present disclosure is to beconsidered an exemplification of the principles of the invention, and isnot intended to limit the invention to that illustrated and describedherein. It is to be fully recognized that the different teachings of theembodiments discussed below may be employed separately or in anysuitable combination to produce desired results. Any use of any form ofthe terms “connect”, “engage”, “couple”, “attach”, or any other termdescribing an interaction between elements is not meant to limit theinteraction to direct interaction between the elements and may alsoinclude indirect interaction between the elements described. The variouscharacteristics mentioned above, as well as other features andcharacteristics described in more detail below, will be readily apparentto those skilled in the art upon reading the following detaileddescription of the embodiments, and by referring to the accompanyingdrawings.

As shown in FIG. 1, a downhole tool 10 may include a hydraulic powermodule 20 that converts electrical into hydraulic power; a probe module30 to take samples of the formation fluids; a flow control module 40regulating the flow of various fluids in and out of the tool; a fluidtest module 50 for performing different tests on a fluid sample; amulti-chamber sample collection module 60 that may contain various sizechambers for storage of the collected fluid samples; a telemetry module70 that provides electrical and data communication between the modulesand an uphole control unit (not shown), and possibly other sectionsdesignated in FIG. 1 collectively as 80. The arrangement of the variousmodules may depend on the specific application and is not consideredherein.

The formation-testing tool 10 may be conveyed in the borehole bywireline, drill string, or any other suitable method. The control unitmay comprise a computer and associated memory for storing programs anddata. The control unit generally controls the operation of tool 10 andprocesses data received from it during operations. The control unit mayhave a variety of associated peripherals, such as a recorder forrecording data, a display for displaying desired information, printersand others. The use of the control unit, display and recorder are knownin the art of well logging and are, thus, not discussed further.

In a specific embodiment, telemetry module 70 may provide bothelectrical and data communication between the modules and the upholecontrol unit. In particular, telemetry module 70 provides high-speeddata bus from the control unit to the modules to download sensorreadings and upload control instructions initiating or ending varioustest cycles and adjusting different parameters, such as the rates atwhich various pumps are operating.

Flow control module 40 of the tool may comprise a double acting pistonpump, which controls the formation fluid flow from the formation intoflow line 15 via probes 32 a and 32 b. The pump operation is generallymonitored by the uphole control unit. Fluid entering the probes 32 a and32 b flows through the flow line 15 and may be discharged into thewellbore via outlet 44. A fluid control device, such as a control valve,may be connected to flow line 15 for controlling the fluid flow from theflow line 15 into the borehole. Flow line fluids can be preferablypumped either up or down with all of the flow line fluid directed intoor though pump 42. Flow control module 40 may further accommodatestrain-gauge pressure transducers that measure an inlet and outlet pumppressures.

The fluid testing section 50 of the tool contains a fluid testing device52, which, analyzes the fluid flowing through flow line 15. It should beappreciated that any suitable device or devices may be utilized toanalyze the fluid. For example, Halliburton Memory Recorder quartz gaugecarrier can be used. In this quartz gauge the pressure resonator,temperature compensation and reference crystal are packaged as a singleunit with each adjacent crystal in direct contact. The assembly iscontained in an oil bath that is hydraulically coupled with the pressurebeing measured. The quartz gauge enables measurement of such parametersas the drawdown pressure of fluid being withdrawn and fluid temperature.Moreover, if two fluid testing devices 52 are run in tandem, thepressure difference between them can be used to determine fluidviscosity during pumping or density when flow is stopped.

Sample collection module 60 of the tool may contain various sizechambers for storage of the collected fluid sample. Chamber section 60preferably contains at least one collection chamber, preferably having apiston that divides chamber 62 into a top chamber 62 a and a bottomchamber 62 b. A conduit is coupled to bottom chamber 62 b to providefluid communication between bottom chamber 62 b and the outsideenvironment such as the wellbore. A fluid flow control device, such asan electrically controlled valve, can be placed in the conduit toselectively open it to allow fluid communication between the bottomchamber 62 b and the wellbore. Similarly, chamber section 62 may alsocontain a fluid flow control device, such as an electrically operatedcontrol valve, which is selectively opened and closed to direct theformation fluid from the flow line 15 into the upper chamber 69 a.

Probe module 30, and more particularly the sealing pad, compriseselectrical and mechanical components that facilitate testing, sampling,and retrieval of fluids from the formation. As known in the art, thesealing pad is the part of the tool or instrument in contact with theformation or formation specimen. A probe is provided with at least onesealing pad providing sealing contact with a surface of the borehole ata desired location. Through one or more slits, fluid flow channels, orrecesses in the sealing pad, fluids from the sealed-off part of theformation surface may be collected within the tester through the fluidpath of the probe.

Probe module 30 generally allows retrieval and sampling of formationfluids in sections of a formation along the longitudinal axis of theborehole. The probe module 30 comprises two or more probes (illustratedas 32 a and 32 b), which may be located in a range of 5 cm to 100 cmapart. For example, each probe has a fluid inlet approximately 1 cm to 5cm in diameter, for example, although other sizes may be used as well indifferent applications.

The fluid testing device 52 may also include as an integratedfunctionality or a separate unit an X-ray source and detectorcombination device to monitor fluid properties after entering eitherprobe for identifying the constituents of the fluid being measured.Alternatively, the X-ray source and detector combination may be locatedat 52′ as shown in FIG. 1 such that X-rays may be transmitted throughthe sample chambers 62 a and 62 b. Also alternatively, in the case of aradioactive isotope source, the X-ray source may be located within asample chamber 62 a or 62 b with at least one detector located outsideof the chamber. Also, in the case the X-ray source is electronic, theelectronics that produce the electrons that impinge on the target may belocated remotely within the tool 10. The availability of an X-ray sourceand energy sensitive detector in the downhole tool 10 enablesexploitation of density differences and elemental specificity inidentifying the presence of borehole fluids in downhole samples.

The use of the X-ray source and detector combination device withspectral measurements that can be made, a determination can be made ofconstituents (in particularly, heavy metals) in the fluid beinganalyzed. In addition, because it is possible to produce images usingX-rays, it is possible to obtain a measure of the homogeneity of thefluid being tested.

The formation-testing tool 10 may be operated by conveying the tool 10into the borehole to a desired location (“depth”). A hydraulic system ofthe tool 10 is deployed to extend rams (not shown) and probes 32 a and32 b, thereby creating a hydraulic seal between the sealing pads of theprobes 32 a and 32 b and the wellbore wall at the zone of interest. Oncethe sealing pad(s) and probes are set, a pretest is generally performed.The formation's permeability and isotropy can also be determined, forexample, as described in U.S. Pat. No. 5,672,819, the content of whichis incorporated herein by reference. Additional formation tests may alsobe performed that involve the collection of fluid samples through theprobes 32 a and 32 b.

To collect the fluid samples in the condition in which such fluid ispresent in the formation, the area near sealing pads is flushed orpumped. The pumping rate of the double acting piston pump 42 may beregulated such that the pressure in flow line 15 near sealing pads ismaintained above a particular pressure of the fluid sample. Thus, whilepiston pump 42 is running, the fluid-testing device 52 can measure fluidproperties. The fluid-testing device 52 may provide information aboutthe contents of the fluid and the presence of any gas bubbles in thefluid to the surface control unit 80. By monitoring the gas bubbles inthe fluid, the flow in the flow line 15 can be constantly adjusted so asto maintain a single-phase fluid in the flow line 15. These fluidproperties and other parameters, such as the pressure and temperature,can be used to monitor the fluid flow while the formation fluid is beingpumped for sample collection.

In addition to these properties, the X-ray source and energy sensitivedetector combination may be utilized to measure the physical parametersof downhole fluids. If the X-ray source is a radioactive isotope, theenergy spectrum of the source may be narrow (mono-energetic). However,if the X-rays are produced using an electron beam impinging on a heavytarget, e.g., tungsten, then the beam will have a distribution ofenergies. For this discussion, the latter type of source is used below.However, much of what is suggested here is applicable with radioactivesource as well.

A first embodiment of the method of using the X-ray source fluididentifier uses the chamber containing drilling fluid from the boreholeannulus or from the formation, for the purpose of obtaining measurementsdependent on the density of fluid in the chamber. A collimated X-raysource is positioned such that X-rays are transmitted through thechamber, and the corresponding detector is situated on the opposite sideof the chamber for detection of X-rays that are transmitted through thechamber. Alternatively, the detection site may not necessarily be oftransmitted X-rays, but of scattered X-rays with the detector placed outof the direct line of the X-rays, detecting the X-rays that arescattered from the original path. In either configuration, the detectedX-ray flux is a function of the density of electrons in the fluid in thechamber, and thereby also a function of the density of the fluid.

Since a goal of fluid testing is to obtain a sample of formation fluid,and to obtain a sample as uncontaminated from the drilling fluid aspossible, the purity of the sample is addressed by drawing drillingfluid directly from the borehole annulus into the testing chamber. Thefluid is exposed to the X-ray source for a period of time that issufficient to obtain a statistically significant and accurate measure ofthe density for the material. This time will be a function of theintensity of the source and calibration characteristics of the system;however, it is straightforward for someone skilled in these measurementsto determine.

As shown in FIG. 1, samples are contained in 42 and in containers 62. Inaddition, the apparatus can be situated outside of flow lines and usedto measure density, composition and homogeneity. One possible X-raysource and detector combination device may include a chemical source ofX-rays used to illuminate the fluid sample and a photodiode that issensitive to X-rays used as the detector. However, it should beappreciated that the source could be either a chemical source of X-raysor gamma rays, or an electronic source of X-rays as, e.g., with aCrooke's tube or an X-ray tube.

This system can be used to assess qualitatively the purity of the fluidin the chamber by comparing the initial response to the borehole fluid,to the response to the fluid “produced” from the formation. As the fluidin the chamber changes from bore fluid to formation fluid, the densityof fluid in the formation chamber will change. It may be that, even inthe case of a perfect seal between the testing tool and the formation, aflow of uncontaminated formation fluid into the chamber may beimpossible to attain. This would be due to adverse values of porosity,permeability, and insufficient mudcake on the borehole wall preventingcontinuous invasion of the formation. In any case the response of theX-ray system to the fluid in the chamber will be dynamic until a stateof equilibrium is reached. That is, at some point one presumes thatunder the particular testing conditions, a maximum fraction of formationfluid will be attained in the fluid chamber. This will be indicated asthe response of the X-ray system to the chamber ceases to change.

An alternative method for assessing the quality of fluid in the chamberutilizes the spectral, or energy sensitive nature of the detectors thatare contemplated for use. In this embodiment, the detector will not be“in line” with the collimated X-ray source, but off to the side, atright angles, or even near 180 degree angles to the initial direction ofthe collimated X-rays. The utility of the method will be enhanced by thepresence, particularly within the borehole fluid, of materialscontaining heavier, higher-Z (viz., atomic number) elements than whatare the atomic constituents of hydrocarbon fluids (hydrogen, carbon, andoxygen). Examples of these elements are barium (in barite weightingmaterial), iron (hematite), and calcium (when calcium carbonate isused).

It is noted that often the drilling fluid weighting materials are insolid, high non-soluble forms (e.g., barite) which are suspended, ratherthan dissolved in the drilling fluid. These materials then are largelyabsent in the drilling fluid contamination of the formation fluid,because they are “filtered” out during the invasion process, forming the“mud cake” on the borehole walls. The invading fluid, or “filtrate” onlycontains those materials which are dissolved, rather than suspended, inthe drilling fluid. Consequently, high-Z materials which are present innon-soluble weighting materials are likely to be largely absent from thefiltrate, reducing the effectiveness of X-ray excitation of higher-Zmaterials as a method for detecting the presence or absence of thefiltrate. To increase this sensitivity to a “guaranteed” level, “tracer”material that is soluble in the filtrate may be added to the mud on thesurface. A candidate for this material is cesium formate, which isalready used in drilling muds and production fluids, but other materialsare also possible.

When the detector is placed so that it will detect X-rays scatteredthrough a higher angle, the number of X-rays detected is substantiallyless than when the detector is place “in line” with the incident beam.Furthermore, scattering through higher angles reduces the characteristicenergy of the X-rays, as described by the Compton scattering equation.The energy and quantity of the scattered X-rays are described by theCompton and Klein-Nishina formulas respectively. The Compton shiftformula is as follows:

$\begin{matrix}{{\lambda^{\prime} - \lambda} = {\frac{h}{m_{e}c}\left( {1 - {\cos\;\theta}} \right)}} & (1)\end{matrix}$

Where λ is the wavelength of the photon before scattering, λ^(i) is thewavelength of the photon after scattering, m_(e) is the mass of theelectron, θ is the angle by which the photon's heading changes, h isPlanck's constant, and c is the speed of light.

The Klein-Nishina formula is as follows:

$\begin{matrix}{\frac{\mathbb{d}\sigma}{\mathbb{d}\Omega} = {\frac{1}{2}{r_{e}^{2}\left( {{P\left( {E_{\gamma},\theta} \right)} - {{P\left( {E_{\gamma},\theta} \right)}^{2}{\sin^{2}(\theta)}} + {P\left( {E_{\gamma},\theta} \right)}^{3}} \right)}}} & (2)\end{matrix}$where θ is the scattering angle; r_(e) is the classical electron radius;m_(e) is the mass of an electron; and P(E_(γ),θ) is the ratio of photonenergy after and before the collision:

$\begin{matrix}{{P\left( {E_{\gamma},\theta} \right)} = \frac{1}{1 + {\frac{E_{\gamma}}{m_{e}c^{2}}\left( {1 - {\cos\;\theta}} \right)}}} & (3)\end{matrix}$

In contrast the energy of the characteristic X-rays is unchanged withangle, as well as largely unaffected in intensity. This difference inthe large angle scattering of X-rays will enhance the relative intensityof characteristic X-rays with respect to the Compton scattered X-raysrays. Spectral sensitivity of the detector allows discrimination ofphotons associated with characteristic X-ray emission from thoseassociated with Compton scattering, and detection at appropriate angleswill maximize the difference in intensity of the two types of gammarays. Comparison of the intensities of gamma rays from these twoscattering mechanisms, in conjunction with characterization of theresponse of the X-ray scattering from the bulk downhole fluid in thechamber, will provide a sensitive mechanism for determination of samplepurity downhole.

A Cadmium Zinc Telluride (CZT) detector is an example of a detector thatis suitable for this application. These detectors typically have aspectral resolution of about 20 Key and are capable of operating at theelevated temperatures characteristic of wellbores. An example of a CZTdetector is manufactured by eV PRODUCTS™, and a typical spectralresponse of a CZT detector is shown in FIG. 2.

Another alternative embodiment includes using the X-ray source anddetection combination to detect fluid heterogeneity, where the formationfluid and/or the formation fluid is made up of two distinct materials(oil/gas/water) which are not thoroughly mixed, but form a heterogeneouscomposition. The differing portions of this composition might bedistinguishable with X-rays using either of the methods discussed above(density or characteristic X-ray detection). In this case exposure timebecomes an even more significant factor in the process if the physicaldistribution of the heterogeneous material is changing rapidly. Thiswould be particularly true if the material in the flow line were beingsampled. One can imagine a “plug” of material of one density passing thedetector, and then a “plug” of a different material of another densitypassing the detector. To detect the heterogeneity, the sampling time ofthe detector must be on the order of or shorter than the time aparticular “plug” is presented to the detector. As those skilled in theart know, the sensitivity of the detector is inversely proportional tothe sampling time, and thus the sensitivity to heterogeneity will be afunction of the sampling time, as well as the X-ray intensity and thedensity contrast or the presence or absence of excitation materials

Assuming the sample in a larger test chamber is a more stable system,i.e., the differing components do not rapidly move from place to placewithin the chamber, another possibility is the detection ofheterogeneity through the use of a two-dimensional, position sensitivedetector, which in effect would function as an X-ray “camera” with anX-ray source 100 and a detector grid 102 as shown, for example, in FIG.3. In either the density transmission or scattering case, each pixel inthe “camera” functions as a measure of the intensity of X-rays travelingthrough a set of possible paths defined by the collimation of the X-raysource, the thickness of the test chamber, and the optical/collimationcharacteristics of the camera/detector. Each pixel in the camera willdetect a number of photons which are an indication of the characteristicof the material in the chamber in the path of the X-rays. For example,as shown, the material may include the fluid sample 104 and impurities106. The detector information for the sample may then be sent to a dataacquisition and image processing module 108 that produces an “image” 110of the sample for analysis. If the heterogeneity of the material in thechamber is such that its spatial variation is on the order of or largerthan the dimensions of these paths, it will be possible to detect thisheterogeneity through a statistical analysis of the count content of thepixels. Again the other enabling factors are the sensitivity of themethod to the density differences in the different constituents of thetest sample, and the sampling time used. It could be assumed that thematerial in the test chamber would be more stable in its location inspace as a function of time than the same material in a flow line.Therefore, the sampling time for this method could be longer than forthe testing in the flow line regime, with a consequent increase insensitivity.

As an example, a typical heterogeneity measure may be performed usingthe following method. Let the total number of pixels in the detectorarray be N. Suppose further that the value that can be represented by agiven pixel ranges from 0-1 (perhaps continually, but in an actualembodiment, in a finite number of increments.) The simplest measure ofheterogeneity is simply the standard deviation of the values in thepixels, which is given by the following formula:

$\begin{matrix}{\overset{\_}{P} = \frac{\sum\limits_{{i = 1},N}\; P_{i}}{N}} & (4) \\{\sigma_{P} = \sqrt{\frac{\sum\limits_{{i = 1},N}\;\left( {P_{1} - \overset{\_}{P}} \right)^{2}}{N - 1}}} & (5)\end{matrix}$

Where P_(i) is the count in pixel I, and P is the average reading overall pixels.

More sophisticated heterogeneity measures are possible. For example, onecan calculate the two-dimensional power spectral density of the image,or produce contours of the image to varying degrees of resolution, asshould be familiar to one skilled in the art.

Furthermore, images can be monitored over time, so as to get a clearerpicture of the dynamics of the fluid properties. In addition, becausethe spectral measurements can be made, a determination can be made ofconstituents (in particularly, heavy metals) in the fluid beinganalyzed.

Also, because it is possible to produce images using X-rays, it ispossible to obtain a measure of the homogeneity of the fluid beingtested. Making this determination in the logging while drillingenvironment results in significant savings, in that at least onecomplete bit trip and wireline logging run will be avoided.

While specific embodiments have been shown and described, modificationscan be made by one skilled in the art without departing from the spiritor teaching of this invention. The embodiments as described areexemplary only and are not limiting. Many variations and modificationsare possible and are within the scope of the invention. Accordingly, thescope of protection is not limited to the embodiments described, but isonly limited by the claims that follow, the scope of which shall includeall equivalents of the subject matter of the claims.

What is claimed is:
 1. A method of determining a property of a sample offluid, including: while in a borehole, collecting a sample of fluid in adownhole tool; while collecting the sample, emitting X-rays from anX-ray source located in the tool and transmitting the X-rays proximateto the fluid; collimating the X rays on a path after the X-rays areemitted from the source; detecting an X-ray flux from the transmittedX-rays with a detector, the flux being a function of a property of thefluid in the downhole tool; and while the downhole tool is in theborehole, processing the detected X-ray flux to determine the propertyof the fluid.
 2. The method of claim 1, wherein at least a portion ofthe fluid sample includes formation fluid.
 3. The method of claim 1,further including detecting the X-ray flux with a detector in-line withthe path of the transmitted X-rays.
 4. The method of claim 1, furtherincluding detecting the X-ray flux with a detector offset from the pathof the transmitted X-rays, the X-ray flux including X-rays scatteredfrom the transmitted path.
 5. The method of claim 4, wherein determiningthe fluid property includes determining the purity of the fluid byanalyzing the flux associated with characteristic X-ray emissioncompared to the flux associated with Compton scattering X-rays.
 6. Themethod of claim 5, further including: introducing a tracer material intothe borehole fluid; wherein collecting a sample of fluid includescollecting a sample of formation fluid; and determining if any of theborehole tracer material is passing into the formation by detecting anyamount of the tracer material present in the sample.
 7. The method ofclaim 1, wherein determining the fluid property includes determining thedensity of the fluid.
 8. The method of claim 7, further includingdetermining the density of the fluid over time and determining if thefluid density substantially equilibrates.
 9. The method of claim 1further including: creating the borehole through a formation using adrill bit on a drill string according to a drilling procedure; conveyingthe downhole tool into the borehole proximate the formation; whereintransmitting the X-rays further includes transmitting collimated X-raysproximate to the fluid on a path from the X-ray source; and determiningwhether to adjust the drilling procedure based on the determined fluidproperty.
 10. The method of claim 9, further including detecting theX-ray flux with a detector in-line with the path of the transmittedX-rays.
 11. The method of claim 9, further including detecting the X-rayflux with a detector offset from the path of the transmitted X-rays, theX-ray flux including X-rays scattered from the transmitted path.
 12. Themethod of claim 11, wherein determining the fluid property includesdetermining the purity of the fluid by analyzing the flux associatedwith characteristic X-ray emission compared to the flux associated withCompton scattering X-rays.
 13. The method of claim 12, furtherincluding: introducing a tracer material into the borehole fluid; anddetermining if any of the borehole tracer material is passing into theformation by detecting any amount of the tracer material present in thesample.
 14. The method of claim 9, wherein determining the fluidproperty includes determining the density of the fluid.
 15. The methodof claim 14, further including determining the density of the fluid overtime and determining if the fluid density substantially equilibrates.16. The method of claim 9, wherein determining the fluid propertyincludes determining the heterogeneity of the fluid.
 17. The methodclaim 16, further including: detecting the flux using a two-dimensional,position sensitive detector such that each position produces a countcontent; and wherein determining the heterogeneity of the sampleincludes analyzing the count content of the positions of the detector.18. The method of claim 16, further including determining theconstituents of the fluid sample.
 19. A method of determining a propertyof a sample of fluid, including: while in a borehole, collecting asample of fluid in a downhole tool; while collecting the sample,transmitting X-rays proximate to the fluid from an X-ray source locatedin the tool; detecting an X-ray flux from the transmitted X-rays with atwo-dimensional, position sensitive detector such that each positionproduces a count content, the flux being a function of a heterogeneityof the fluid in the downhole tool; and while the downhole tool is in theborehole, processing the detected X-ray flux to determine theheterogeneity of the fluid by analyzing the count content of thepositions of the detector.
 20. The method of claim 19, further includingdetermining the constituents of the fluid sample.
 21. A system used inthe method of claim 1, and further including: a formation testerconveyable downhole into the borehole, the formation tester including: aprobe engageable with a formation to form a seal and such that fluidcommunication between the formation and the interior of the formationtester is established; a mechanism controlling the collection of thefluid sample through the probe and into the formation tester; a fluidtesting device including the X-ray source and the detector, the X-raysource for transmitting the X-rays and the detector for detecting theX-ray flux that is the function of the fluid property; and a controlunit including a processor for processing the detected X-ray flux todetermine the fluid property.
 22. The system of claim 21, wherein theX-ray source is capable of transmitting the collimated X-rays on thepath.
 23. The system of claim 22, further including the detector beinglocated in-line with the X-ray transmission path.
 24. The system ofclaim 22, further including the detector being offset from the path ofthe transmitted X-rays such that the detectable X-ray flux includesX-rays scattered from the transmitted path.
 25. The system of claim 24,wherein the detector is capable of differentiating the flux associatedwith characteristic X-ray emission compared to the flux associated withCompton scattering X-rays and the determinable fluid property includesthe purity of the fluid.
 26. The system of claim 21, wherein thedeterminable fluid property includes the density of the fluid.
 27. Thesystem of claim 26, wherein the density of the fluid is capable of beingdetermined as a function of time such that the processor is capable ofdetermining when the fluid density substantially equilibrates.
 28. Thesystem of claim 21, wherein determinable fluid property includes theheterogeneity of the fluid.
 29. The system of claim 21, wherein thedeterminable property includes the constituency of the fluid sample. 30.A system used in the method of claim 19, and further including: aformation tester conveyable downhole into the borehole, the formationtester including: a probe engageable with a formation to form a seal andsuch that fluid communication between the formation and the interior ofthe formation tester is established; a mechanism controlling thecollection of the fluid sample through the probe and into the formationtester; a fluid testing device including the X-ray source and thetwo-dimensional, position sensitive detector; and a control unitincluding a processor for processing the detected X-ray flux; whereinthe two-dimensional, position sensitive detector is capable of producingthe count content representative of the detected flux at each position;and wherein the processor is capable of determining the heterogeneity ofthe fluid by analyzing the count content of the positions of thedetector.
 31. A system used in the method of claim 9, and furtherincluding: a formation tester conveyable downhole into the borehole, theformation tester including: a probe engageable with the formation toform a seal and such that fluid communication between the formation andthe interior of the formation tester is established; a mechanismcontrolling the collection of the fluid sample through the probe andinto the formation tester; a fluid testing device including the X-raysource and the detector, the X-ray source for transmitting thecollimated X-rays on the path and the detector for detecting the X-rayflux that is the function of the fluid property; and a control unitincluding a processor for processing the detected X-ray flux todetermine the fluid property.
 32. The system of claim 31, furtherincluding the detector being located in-line with the X-ray transmissionpath.
 33. The system of claim 31, further including the detector beingoffset from the path of the transmitted X-rays such that the detectableX-ray flux includes X-rays scattered from the transmitted path.
 34. Thesystem of claim 33, wherein the detector is capable of differentiatingthe flux associated with characteristic X-ray emission compared to theflux associated with Compton scattering X-rays and the determinablefluid property includes the purity of the fluid.
 35. The system of claim34, further including: borehole fluid located in the borehole, theborehole fluid including a soluble tracer material; and wherein thedetector is capable of determining any presence of the borehole fluidtracer material in the fluid sample.
 36. The system of claim 31, whereinthe determinable fluid property includes the density of the fluid. 37.The system of claim 36, wherein the density of the fluid is capable ofbeing determined as a function of time such that the processor iscapable of determining when the fluid density substantiallyequilibrates.
 38. The system of claim 31, wherein determinable fluidproperty includes the heterogeneity of the fluid.
 39. The system claim38, further including: wherein the detector includes a two-dimensional,position sensitive detector capable of producing a count contentrepresentative of the detected flux at each position; and wherein theprocessor is capable of determining the heterogeneity of the sample byanalyzing the count content of the positions of the detector.
 40. Thesystem of claim 31, wherein the determinable property includes theconstituency of the fluid sample.